﻿{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/search.css?version={$version}">
<link rel="stylesheet" style="text/css" href="__PUBLIC__/Css/front/detail.css?version={$version}">
<script>
    function no_pic(obj) {
        obj.setAttribute("src", "/Public/Images/acp/nopicture.jpg");
    }
</script>
{/block}
{block name="content"}
{include file="../search_form.html"}
	<!--筛选导航排序-->
  
{include file="../FrontMall/item_list_common.html"}
{/block}
{block name="js"}
<script type="text/javascript" src="__PUBLIC__/Js/front/iscroll.js?version={$version}"></script>
<script type="text/javascript" src="__PUBLIC__/Js/front/slide_nav.js?version={$version}"></script>
<script src="__PUBLIC__/Js/front/item.js?version={$version}"></script>
<script>
var firstRow = '{$firstRow}';
var total = parseInt('{$total}');
var orderby = parseInt('{$orderby}');
var class_id = parseInt('{$class_id}');
var class_tag = '{$class_tag}';
var keyword = '{$keyword}';
var trading_area_id = parseInt('{$trading_area_id}');
{literal}
$(function()
{
	var range = 20; //距下边界长度/单位px  
	var elemt = 500; //插入元素高度/单位px  
	var num = firstRow;  
	var totalheight = 0;  
	var main = $("#going_list"); //主体元素  
	$(window).scroll(function()
	{
		var srollPos = $(window).scrollTop(); //滚动条距顶部距离(页面超出窗口的高度)   
		totalheight = parseFloat($(window).height()) + parseFloat(srollPos);  
		if(($(document).height()-range) <= totalheight  && total > num)
		{
			num = parseInt(num) + parseInt(firstRow);
			//获取订单列表
			$.post('/FrontSearch/get_item_list', {"firstRow":num - parseInt(firstRow), "class_id":class_id, "class_tag":class_tag, "keyword":keyword, "trading_area_id":trading_area_id, "orderby":orderby}, function(data, textStatus) 
			 {
				if (data != 'failure')
				{
					var len = data.length;
					for (i = 0; i < len; i++)
					{
						var html = '<li class="item_cont" onclick="show_detail(this);"><input type="hidden" id="item_id" value="' + data[i].item_id + '"><input type="hidden" id="item_unit" value="' + data[i].unit + '"><input type="hidden" id="base_img" value="' + data[i].base_pic + '"><input type="hidden" id="item_price" value="' + data[i].mall_price + '"><a class="item_link" href="javascript:;"><div class="item_pic_wrap"><div class="item_pic"><img src="' + data[i].small_img + '" onerror="no_pic(this);"/></div></div><div class="content"><div class="item_name"><span class="item_name_txt" id="item_name_txt">' + data[i].item_name + '</span></div><div class="shop_name"><span class="shop_name_txt"></span></div><div class="item_desc"><span class="item_desc_txt" id="item_desc_txt">' + data[i].item_desc + '</span></div><div class="item_intro"><span class="item_price"><i class="rmb_symbol">￥</i>' + data[i].mall_price + '</span><span class="sale_num"><i class="sale_num_txt">' + data[i].sales_num + '</i>销售量</span></div></div></a></li>';
						main.append(html);
					}
				}
			}, 'json');
		}  
		else
		{
			$('#order_ending').show();
		}
	}); 
	
});	


</script>  
{/literal}
{/block}
